<template>
  <h2>LOGO</h2>
  <el-form
    ref="ruleFormRef"
    :model="ruleForm"
    :rules="rules"
    label-width="120px"
    class="demo-ruleForm"
    :size="formSize"
    status-icon
  >
    <el-form-item prop="name">
      <el-input v-model="ruleForm.name" />
    </el-form-item>
    <el-form-item prop="password">
      <el-input v-model="ruleForm.password" />
    </el-form-item>
    <el-from-item
      style="
        margin-left: 120px;
        width: 250px;
        display: flex;
        justify-content: space-between;
        align-items: center;
      "
    >
      <el-checkbox v-model="checked1" label="记住密码" size="large" />
      <p @click="goPassword">忘记密码</p>
    </el-from-item>
    <el-form-item @click="goHome">
      <button>登录</button>
    </el-form-item>
  </el-form>
</template>

<script setup>
import { reactive, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
const formSize = ref("default");
const ruleForm = reactive({
  name: "账户",
  password: "密码",
});

const rules = reactive({
  name: [{ required: true, message: "请输入账户", trigger: "blur" }],
  password: [
    {
      required: true,
      message: "请输入密码",
      trigger: "change",
    },
  ],
});

//找回密码
const goPassword = () => {
  router.push({ path: "/password" });
};

// 登录
const goHome = () => {
  router.push({ path: "/staging" });
};
</script>

<style lang="scss" scoped>
h2 {
  margin: 0;
  padding: 0;
  color: #3bb19c;
  text-align: center;
  margin: 0;
}
button {
  background-color: #3bb19c;
  color: #fff;
  border-radius: 5px;
  width: 250px;
  height: 35px;
  line-height: 35px;
  border: 0;
}
</style>
